<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SC Transportes - Cadastro Veículo</title>
#{set 'moreStyles'}
        #{stylesheet 'main.css' /}
#{/set}
#{get 'moreStyles' /}
</head>

<body>

	<div id="wrapper">

        <div id="logomarca">
        </div><!-- #logomarca-->
        
        <div id="titleBar">
            Cadastro > <span>Novo Modelo</span>
        <a class="sair" href="@{Application.index()}">Sair</a> </div><!-- #titleBar -->
        
        <div id="content">
        	<form action="@{ModeloApplication.cadastrarModelo()}" method="post">
	        	<div style="color: red; font-weight: bold; text-align: center;">
	        		#{if erros != null}
		        		#{list items:erros, as:'erro'}
							${erro}
							<br/>
							<br/>
						#{/list}
					#{/if}
	        	</div>
	            <table width="600" cellpadding="0" cellspacing="5">
	                <tr>
	                    <td valign="top">Marca:</td>
	                    <td>
	                        <select name="idMarca">
								<option value="0" selected="selected"> -- SELECIONE -- </option>
								#{list items:marcas, as:'marca'}
									#{if modelo.marca == marca}
									<option value="${marca.id}" selected="selected">${marca.nome}</option>
									#{/if}
									#{else}
									<option value="${marca.id}">${marca.nome}</option>
									#{/else}
								#{/list}
							</select>
	                    </td>
	                </tr>
	                <tr>
	                    <td valign="top">Tipo:</td>
	                    <td>
							<select name="idTipo">
								<option value="0" selected="selected"> -- SELECIONE -- </option>
								#{list items:tipos, as:'tipo'}
									#{if modelo.tipo == tipo}
									<option value="${tipo.id}" selected="selected">${tipo.nome}</option>
									#{/if}
									#{else}
									<option value="${tipo.id}">${tipo.nome}</option>
									#{/else}
								#{/list}
							</select>
	                    </td>
	                </tr>
	                <tr>
	                	<td valign="top">Descrição:</td>
	                    <td>
	                		<input type="text" name="nome" value="${modelo.nome}" />
	                	</td>
	                </tr>
	                <tr>
	                    <td></td>
	                    <td>
	                    	<input type="hidden" name="idModelo" value="${modelo.id}"/>
	                        <input type="submit" class="button" value="${modelo.id > 0 ? 'Editar' : 'Cadastrar'}" />
	                        <a href="@{Application.cancelar()}"><input type="button" class="button" value="Cancelar" /></a>
	                    </td>
	                </tr>
	            </table>
            </form>
        </div><!-- #content -->
      
        <div id="footer">
        	2012 - SC Transporte - Todos os direitos reservados
        </div><!-- #footer -->
        
	</div><!-- #wrapper -->

</body>
</html>